<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Coverage Report</title>
<link title="Style" type="text/css" rel="stylesheet" href="css/main.css"/>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<h5>Coverage Report - scanner.State</h5>
<div class="separator">&nbsp;</div>
<table class="report">
<thead><tr>  <td class="heading">Classes in this File</td>  <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Line Coverage</a></td>  <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Branch Coverage</a></td>  <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Complexity</a></td></tr></thead>
  <tr><td><a href="scanner.State.html">State</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">86%</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:86px"><span class="text">93/108</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">93%</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:93px"><span class="text">28/30</span></div></div></td></tr></table></td><td class="value"><span class="hidden">3.4;</span>3.4</td></tr>

</table>
<div class="separator">&nbsp;</div>
<table cellspacing="0" cellpadding="0" class="src">
<tr>  <td class="numLine">&nbsp;1</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">package</span> scanner;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;2</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;3</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> java.util.Vector;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;4</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">import</span> abc.parser.AbcTokenType;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;5</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;6</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">/** This class defines states used in finale state automata. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;7</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="keyword">public</span> <span class="keyword">class</span> State <span class="keyword">implements</span> Cloneable</pre></td></tr>
<tr>  <td class="numLine">&nbsp;8</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;{</pre></td></tr>
<tr>  <td class="numLine">&nbsp;9</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** Transitions from this state. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;10</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> Vector transitions;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;11</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** The array representation of transitions from this state. */</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;12</td>  <td class="nbHitsCovered">&nbsp;3219</td>  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> Transition[] m_transitionsArrayCache=<span class="keyword">null</span>;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;13</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** &lt;TT&gt;true&lt;/TT&gt; if this state is a token state. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;14</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">boolean</span> isTokenState;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;15</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** The type of this state. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;16</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> TokenType m_type;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;17</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;18</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** Constructs a new state.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;19</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param type The type of the state.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;20</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param isTokenStateValue &lt;TT&gt;true&lt;/TT&gt; if the state is a token state,</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;21</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;TT&gt;falsew&lt;/TT&gt; otherwise. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;22</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> State(TokenType type, <span class="keyword">boolean</span> isTokenStateValue)</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;23</td>  <td class="nbHitsCovered">&nbsp;3219</td>  <td class="src"><pre class="src">&nbsp;    {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;24</td>  <td class="nbHitsCovered">&nbsp;3219</td>  <td class="src"><pre class="src">&nbsp;        m_type = type;</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;25</td>  <td class="nbHitsCovered">&nbsp;3219</td>  <td class="src"><pre class="src">&nbsp;        isTokenState = isTokenStateValue;</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;26</td>  <td class="nbHitsCovered">&nbsp;3219</td>  <td class="src"><pre class="src">&nbsp;        transitions = <span class="keyword">new</span> Vector();</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;27</td>  <td class="nbHitsCovered">&nbsp;3219</td>  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;28</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;29</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** Returns the type of this state.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;30</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return The type of this state. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;31</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> TokenType getType()</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;32</td>  <td class="nbHitsCovered">&nbsp;175098</td>  <td class="src"><pre class="src">&nbsp;    { <span class="keyword">return</span> m_type; }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;33</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;34</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** Returns an array containing transitions from this state.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;35</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return an array containing transitions from this state. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;36</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> Transition[]  getTransitions()</pre></td></tr>
<tr>  <td class="numLine">&nbsp;37</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;38</td>  <td class="nbHitsCovered">&nbsp;5007</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">if</span> (m_transitionsArrayCache==<span class="keyword">null</span>)</pre></td></tr>
<tr>  <td class="numLine">&nbsp;39</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;40</td>  <td class="nbHitsCovered">&nbsp;3077</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">int</span> size = transitions.size();</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;41</td>  <td class="nbHitsCovered">&nbsp;3077</td>  <td class="src"><pre class="src">&nbsp;        m_transitionsArrayCache = <span class="keyword">new</span> Transition[size];</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;42</td>  <td class="nbHitsCovered">&nbsp;36404</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (<span class="keyword">int</span> i=0; i&lt;size;i++)</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;43</td>  <td class="nbHitsCovered">&nbsp;33327</td>  <td class="src"><pre class="src">&nbsp;          m_transitionsArrayCache[i] = (Transition)transitions.elementAt(i);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;44</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      }</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;45</td>  <td class="nbHitsCovered">&nbsp;5007</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">return</span> m_transitionsArrayCache;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;46</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;47</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      <span class="comment">//return (Transition[])(transitions.toArray(new Transition[transitions.size()]));</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;48</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;49</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;50</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** Returns the transition that can be activated for the specified character.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;51</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param character A character.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;52</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return The transition that can be activated for the specified character.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;53</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;TT&gt;null&lt;/TT&gt; is returned if no transition is specified from this state</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;54</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * for the given character. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;55</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> Transition getTransitionFor(<span class="keyword">char</span> character)</pre></td></tr>
<tr>  <td class="numLine">&nbsp;56</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;57</td>  <td class="nbHitsCovered">&nbsp;1548615</td>  <td class="src"><pre class="src">&nbsp;      Transition matchingTransition = <span class="keyword">null</span>;</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;58</td>  <td class="nbHitsCovered">&nbsp;1548615</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">int</span> m_transitionsNb = transitions.size();</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;59</td>  <td class="nbHitsCovered">&nbsp;1548615</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">int</span> transitionIndex = 0;</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;60</td>  <td class="nbHitsCovered">&nbsp;6583398</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">while</span> (matchingTransition==<span class="keyword">null</span> &amp;&amp; transitionIndex&lt;m_transitionsNb)</pre></td></tr>
<tr>  <td class="numLine">&nbsp;61</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;62</td>  <td class="nbHitsCovered">&nbsp;5034783</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (((Transition)transitions.elementAt(transitionIndex)).isPossible(character))</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;63</td>  <td class="nbHitsCovered">&nbsp;1257432</td>  <td class="src"><pre class="src">&nbsp;          matchingTransition = (Transition)transitions.elementAt(transitionIndex);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;64</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">else</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;65</td>  <td class="nbHitsCovered">&nbsp;3777351</td>  <td class="src"><pre class="src">&nbsp;          transitionIndex++;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;66</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      }</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;67</td>  <td class="nbHitsCovered">&nbsp;1548615</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">return</span> matchingTransition;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;68</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;69</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;70</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** Returns &lt;TT&gt;true&lt;/TT&gt; if this state has self transitions. A self</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;71</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * transition is a transition whose target state is equals to the source state.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;72</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return &lt;TT&gt;true&lt;/TT&gt; if this state has self transitions, &lt;TT&gt;false&lt;/TT&gt;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;73</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * otherwise. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;74</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">boolean</span> hasSelfTransitions()</pre></td></tr>
<tr>  <td class="numLine">&nbsp;75</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    {</pre></td></tr>
<tr>  <td class="numLine">&nbsp;76</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      <span class="comment">//boolean hasSelfTransitions = false;</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;77</td>  <td class="nbHitsCovered">&nbsp;28831</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">for</span> (<span class="keyword">int</span> i=0; i&lt;transitions.size(); i++)</pre></td></tr>
<tr>  <td class="numLine">&nbsp;78</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;79</td>  <td class="nbHitsCovered">&nbsp;26432</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (((Transition)transitions.elementAt(i)).isSelfTransition())</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;80</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;          <span class="keyword">return</span> <span class="keyword">true</span>;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;81</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      }</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;82</td>  <td class="nbHitsCovered">&nbsp;2399</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">return</span> <span class="keyword">false</span>;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;83</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;84</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;85</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** Returns the number of transitions from this state.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;86</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return the number of transitions from this state. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;87</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">int</span> countTransitions()</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;88</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;    { <span class="keyword">return</span> transitions.size();  }</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;89</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;90</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** Sets the type of this state.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;91</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param type The new type of this state. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;92</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setType(TokenType type)</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;93</td>  <td class="nbHitsCovered">&nbsp;1983</td>  <td class="src"><pre class="src">&nbsp;    { m_type = type; }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;94</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;95</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** Sets if this state is a token state or not.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;96</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param isToken &lt;TT&gt;true&lt;/TT&gt; if this state is a token state,</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;97</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;TT&gt;false&lt;/TT&gt; otherwise. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;98</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> setTokenState(<span class="keyword">boolean</span> isToken)</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;99</td>  <td class="nbHitsCovered">&nbsp;158</td>  <td class="src"><pre class="src">&nbsp;    { isTokenState = isToken; }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;100</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;101</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** Returns &lt;TT&gt;true&lt;/TT&gt; if this state is a token state.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;102</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return &lt;TT&gt;true&lt;/TT&gt; if this state is a token state,</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;103</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * &lt;TT&gt;false&lt;/TT&gt; otherwise. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;104</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">boolean</span> isTokenState()</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;105</td>  <td class="nbHitsCovered">&nbsp;303853</td>  <td class="src"><pre class="src">&nbsp;    { <span class="keyword">return</span> isTokenState; }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;106</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;107</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** Adds a transition to this state.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;108</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param transition The transition to be added to this state.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;109</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see #removeTransition(scanner.Transition) */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;110</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">void</span> addTransition(Transition transition)</pre></td></tr>
<tr>  <td class="numLine">&nbsp;111</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;112</td>  <td class="nbHitsCovered">&nbsp;29954</td>  <td class="src"><pre class="src">&nbsp;      transitions.addElement(transition);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;113</td>  <td class="nbHitsCovered">&nbsp;29954</td>  <td class="src"><pre class="src">&nbsp;      transition.setSourceState(<span class="keyword">this</span>);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;114</td>  <td class="nbHitsCovered">&nbsp;29954</td>  <td class="src"><pre class="src">&nbsp;      m_transitionsArrayCache=<span class="keyword">null</span>;</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;115</td>  <td class="nbHitsCovered">&nbsp;29954</td>  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;116</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;117</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**Removes the given transition.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;118</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param transition The transition to be removed.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;119</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return &lt;TT&gt;true&lt;/TT&gt; if the given transition was one of this state's</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;120</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * transition, &lt;TT&gt;false&lt;/TT&gt; otherwise.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;121</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @see #addTransition(scanner.Transition) */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;122</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> <span class="keyword">boolean</span> removeTransition(Transition transition)</pre></td></tr>
<tr>  <td class="numLine">&nbsp;123</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;124</td>  <td class="nbHitsCovered">&nbsp;560</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">if</span>(transitions.removeElement(transition))</pre></td></tr>
<tr>  <td class="numLine">&nbsp;125</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;126</td>  <td class="nbHitsCovered">&nbsp;560</td>  <td class="src"><pre class="src">&nbsp;        transition.setSourceState(<span class="keyword">null</span>);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;127</td>  <td class="nbHitsCovered">&nbsp;560</td>  <td class="src"><pre class="src">&nbsp;        m_transitionsArrayCache=<span class="keyword">null</span>;</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;128</td>  <td class="nbHitsCovered">&nbsp;560</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">return</span> <span class="keyword">true</span>;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;129</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;130</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      <span class="keyword">else</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;131</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        <span class="keyword">return</span> <span class="keyword">false</span>;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;132</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;133</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;134</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/**</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;135</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Performs an union between this state and the given one.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;136</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Union between a token state and a non token state will give a token state.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;137</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Union between 2 non token states will give a non token state.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;138</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Union between 2 token states is possible only if only one of them has</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;139</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * self transitions.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;140</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Union between 2 token states that both have self transitions will throw</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;141</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * a runtime exception.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;142</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * Union between 2 token states that both haven't any self transition</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;143</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * will return the state given as paremeter</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;144</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param state a State</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;145</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @return State The resulting union from this state and the given one.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;146</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;147</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> State union(State state)</pre></td></tr>
<tr>  <td class="numLine">&nbsp;148</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;149</td>  <td class="nbHitsCovered">&nbsp;2464</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">if</span> (isTokenState() &amp;&amp; state.isTokenState())</pre></td></tr>
<tr>  <td class="numLine">&nbsp;150</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      {</pre></td></tr>
<tr>  <td class="numLine">&nbsp;151</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">//System.out.println(getType()+" " + isTokenState() + " union("</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;152</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">//  + state.getType() + " " + state.isTokenState() + ")");</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;153</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">//Should be there's but this is due to conflicts between token types.</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;154</td>  <td class="nbHitsCovered">&nbsp;140</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (getType().equals(AbcTokenType.TEXT))</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;155</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;          <span class="keyword">return</span> state;</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;156</td>  <td class="nbHitsCovered">&nbsp;140</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (state.getType().equals(AbcTokenType.TEXT))</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;157</td>  <td class="nbHitsCovered">&nbsp;113</td>  <td class="src"><pre class="src">&nbsp;          <span class="keyword">return</span> <span class="keyword">this</span>;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;158</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">/*if (getType().equals(AbcTokenType.KEY_ACCIDENTAL))</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;159</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">          return this;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;160</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">        if (state.getType().equals(AbcTokenType.KEY_ACCIDENTAL))</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;161</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">          return state;*/</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;162</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      }</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;163</td>  <td class="nbHitsCovered">&nbsp;2351</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">if</span> (isTokenState() &amp;&amp; state.isTokenState())</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;164</td>  <td class="nbHitsCovered">&nbsp;27</td>  <td class="src"><pre class="src">&nbsp;       <span class="keyword">if</span> (hasSelfTransitions() &amp;&amp; state.hasSelfTransitions())</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;165</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;         <span class="keyword">throw</span> <span class="keyword">new</span> RuntimeException(<span class="string">"BOTH ARE TOKENS ! : "</span> + <span class="keyword">this</span>.getType() + <span class="string">" and "</span> + state.getType());</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;166</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">else</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;167</td>  <td class="nbHitsCovered">&nbsp;27</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (!hasSelfTransitions() &amp;&amp; !state.hasSelfTransitions())</pre></td></tr>
<tr>  <td class="numLine">&nbsp;168</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        {</pre></td></tr>
<tr>  <td class="numLine">&nbsp;169</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          <span class="comment">//System.err.println("warning : ambiguity between " + this.getType() + " and "</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;170</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          <span class="comment">//                   + state.getType() + " : returning " + state);</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;171</td>  <td class="nbHitsCovered">&nbsp;27</td>  <td class="src"><pre class="src">&nbsp;          <span class="keyword">return</span> state;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;172</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;173</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">/*          (</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;174</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">        (hasSelfTransitions() &amp;&amp; state.hasSelfTransitions())</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;175</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">        ||(!hasSelfTransitions() &amp;&amp; !state.hasSelfTransitions())</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;176</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">          )</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;177</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">          )</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;178</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">        throw new RuntimeException("BOTH ARE TOKENS ! : " + this.getType() + " and " + state.getType());*/</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;179</td>  <td class="nbHitsCovered">&nbsp;2324</td>  <td class="src"><pre class="src">&nbsp;      State returnedState = (State)clone();</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;180</td>  <td class="nbHitsCovered">&nbsp;2324</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">boolean</span> hasSelfTransition = hasSelfTransitions();</pre></td></tr>
<tr>  <td class="numLine">&nbsp;181</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      <span class="comment">//boolean parameterSelfTransition = state.hasSelfTransitions();</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;182</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;183</td>  <td class="nbHitsCovered">&nbsp;2324</td>  <td class="src"><pre class="src">&nbsp;      Transition[] targetTransitions = state.getTransitions();</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;184</td>  <td class="nbHitsCovered">&nbsp;5007</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i &lt; targetTransitions.length; i++)</pre></td></tr>
<tr>  <td class="numLine">&nbsp;185</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;186</td>  <td class="nbHitsCovered">&nbsp;2683</td>  <td class="src"><pre class="src">&nbsp;        Transition currentTargetTransition = (Transition)targetTransitions[i];</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;187</td>  <td class="nbHitsCovered">&nbsp;2683</td>  <td class="src"><pre class="src">&nbsp;        currentTargetTransition = <span class="keyword">new</span> Transition(currentTargetTransition.getTargetState(), currentTargetTransition.getChars());</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;188</td>  <td class="nbHitsCovered">&nbsp;2683</td>  <td class="src"><pre class="src">&nbsp;        Transition[] returnedStateTransitions = returnedState.getTransitions();</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;189</td>  <td class="nbHitsCovered">&nbsp;35545</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">for</span> (<span class="keyword">int</span> j = 0; j &lt; returnedStateTransitions.length; j++)</pre></td></tr>
<tr>  <td class="numLine">&nbsp;190</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;191</td>  <td class="nbHitsCovered">&nbsp;32862</td>  <td class="src"><pre class="src">&nbsp;          Transition currentTransition = (Transition)returnedStateTransitions[j];</pre></td></tr>
<tr>  <td class="numLine">&nbsp;192</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          <span class="comment">// Any self transition ?</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;193</td>  <td class="nbHitsCovered">&nbsp;32862</td>  <td class="src"><pre class="src">&nbsp;          <span class="keyword">if</span> (currentTransition.isSelfTransition() &amp;&amp; currentTargetTransition.isSelfTransition())</pre></td></tr>
<tr>  <td class="numLine">&nbsp;194</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">//are they all self transitions ?</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;195</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            currentTransition.add(currentTargetTransition.getChars());</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;196</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          <span class="keyword">else</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;197</td>  <td class="nbHitsCovered">&nbsp;32862</td>  <td class="src"><pre class="src">&nbsp;          <span class="keyword">if</span> (currentTransition.isSelfTransition())</pre></td></tr>
<tr>  <td class="numLine">&nbsp;198</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;199</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;            returnedState.convertSelfTransition(currentTransition);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;200</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;            returnedState = returnedState.union(state);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;201</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;202</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          <span class="keyword">else</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;203</td>  <td class="nbHitsCovered">&nbsp;32856</td>  <td class="src"><pre class="src">&nbsp;          <span class="keyword">if</span> (currentTargetTransition.isSelfTransition())</pre></td></tr>
<tr>  <td class="numLine">&nbsp;204</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;205</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            state.convertSelfTransition(currentTargetTransition);</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;206</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            returnedState = returnedState.union(state);</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;207</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;208</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          <span class="keyword">else</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;209</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          {</pre></td></tr>
<tr>  <td class="numLine">&nbsp;210</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">//NO self transition =&gt; manage intersections....</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;211</td>  <td class="nbHitsCovered">&nbsp;32856</td>  <td class="src"><pre class="src">&nbsp;            <span class="keyword">char</span>[] intersection = currentTransition.intersect(currentTargetTransition.getChars());</pre></td></tr>
<tr>  <td class="numLine">&nbsp;212</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            <span class="comment">// We have to manage an intersection....</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;213</td>  <td class="nbHitsCovered">&nbsp;32856</td>  <td class="src"><pre class="src">&nbsp;            <span class="keyword">if</span> (intersection.length != 0)</pre></td></tr>
<tr>  <td class="numLine">&nbsp;214</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;215</td>  <td class="nbHitsCovered">&nbsp;716</td>  <td class="src"><pre class="src">&nbsp;              currentTransition.substract(intersection);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;216</td>  <td class="nbHitsCovered">&nbsp;716</td>  <td class="src"><pre class="src">&nbsp;              <span class="keyword">if</span> (currentTransition.getChars().length == 0)</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;217</td>  <td class="nbHitsCovered">&nbsp;554</td>  <td class="src"><pre class="src">&nbsp;                returnedState.removeTransition(currentTransition);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;218</td>  <td class="nbHitsCovered">&nbsp;716</td>  <td class="src"><pre class="src">&nbsp;              currentTargetTransition.substract(intersection);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;219</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;220</td>  <td class="nbHitsCovered">&nbsp;716</td>  <td class="src"><pre class="src">&nbsp;              State unionState = currentTransition.getTargetState().union(currentTargetTransition.getTargetState());</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;221</td>  <td class="nbHitsCovered">&nbsp;716</td>  <td class="src"><pre class="src">&nbsp;              Transition newtransition = <span class="keyword">new</span> Transition(unionState, intersection);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;222</td>  <td class="nbHitsCovered">&nbsp;716</td>  <td class="src"><pre class="src">&nbsp;              returnedState.addTransition(newtransition);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;223</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;            }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;224</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;225</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        } <span class="comment">// end for</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;226</td>  <td class="nbHitsCovered">&nbsp;2683</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (currentTargetTransition.getChars().length != 0)</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;227</td>  <td class="nbHitsCovered">&nbsp;2219</td>  <td class="src"><pre class="src">&nbsp;          returnedState.addTransition(currentTargetTransition);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;228</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;229</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      <span class="comment">//sets the name</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;230</td>  <td class="nbHitsCovered">&nbsp;2324</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">if</span> (isTokenState())</pre></td></tr>
<tr>  <td class="numLine">&nbsp;231</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;232</td>  <td class="nbHitsCovered">&nbsp;341</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (state.isTokenState())</pre></td></tr>
<tr>  <td class="numLine">&nbsp;233</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        {</pre></td></tr>
<tr>  <td class="numLine">&nbsp;234</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          <span class="comment">//both are tokens.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;235</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          <span class="comment">//System.out.println("============================TWO TOKENS :" + this + "  " + state);</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;236</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;          <span class="keyword">if</span> (hasSelfTransition)</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;237</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;            returnedState.setType(state.getType());</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;238</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          <span class="comment">// we cannot have both with self transitions.</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;239</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;240</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">else</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;241</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        {</pre></td></tr>
<tr>  <td class="numLine">&nbsp;242</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          <span class="comment">//this is the only token =&gt;return should have is name=&gt; already the case with this .clone()</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;243</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;244</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;245</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      <span class="keyword">else</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;246</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;247</td>  <td class="nbHitsCovered">&nbsp;1983</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (state.isTokenState())</pre></td></tr>
<tr>  <td class="numLine">&nbsp;248</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        {</pre></td></tr>
<tr>  <td class="numLine">&nbsp;249</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          <span class="comment">//this is not token but state is.</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;250</td>  <td class="nbHitsCovered">&nbsp;158</td>  <td class="src"><pre class="src">&nbsp;          returnedState.setTokenState(<span class="keyword">true</span>);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;251</td>  <td class="nbHitsCovered">&nbsp;158</td>  <td class="src"><pre class="src">&nbsp;          returnedState.setType(state.getType());</pre></td></tr>
<tr>  <td class="numLine">&nbsp;252</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;253</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">else</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;254</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;255</td>  <td class="nbHitsCovered">&nbsp;1825</td>  <td class="src"><pre class="src">&nbsp;          <span class="keyword">if</span> (getType().equals(state.getType()))</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;256</td>  <td class="nbHitsCovered">&nbsp;1825</td>  <td class="src"><pre class="src">&nbsp;            returnedState.setType(getType());</pre></td></tr>
<tr>  <td class="numLine">&nbsp;257</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;          <span class="keyword">else</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;258</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;          returnedState.setType(TokenType.UNKNOWN);</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;259</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;260</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      }</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;261</td>  <td class="nbHitsCovered">&nbsp;2324</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">return</span> returnedState;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;262</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;263</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;264</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="comment">/** Convert the given self transition to a transition to a new state (a</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;265</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * clone of this one).</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;266</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;<span class="comment">     * @param selfTransition The self transition to be converted. */</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;267</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">private</span> <span class="keyword">void</span> convertSelfTransition(Transition selfTransition)</pre></td></tr>
<tr>  <td class="numLine">&nbsp;268</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;269</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">if</span> (selfTransition.isSelfTransition() &amp;&amp; selfTransition.getSourceState().equals(<span class="keyword">this</span>))</pre></td></tr>
<tr>  <td class="numLine">&nbsp;270</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;271</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;        removeTransition(selfTransition);</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;272</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;        State tempState = (State)clone();</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;273</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;        Transition transition = <span class="keyword">new</span> Transition(tempState, selfTransition.getChars());</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;274</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;        addTransition(transition);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;275</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      }</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;276</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;277</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;278</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> Object clone()</pre></td></tr>
<tr>  <td class="numLine">&nbsp;279</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;280</td>  <td class="nbHitsCovered">&nbsp;2330</td>  <td class="src"><pre class="src">&nbsp;      State state = <span class="keyword">new</span> State(getType(), isTokenState());</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;281</td>  <td class="nbHitsCovered">&nbsp;2330</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">int</span> size = transitions.size();</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;282</td>  <td class="nbHitsCovered">&nbsp;28726</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">for</span> (<span class="keyword">int</span> i=0; i&lt;size; i++)</pre></td></tr>
<tr>  <td class="numLine">&nbsp;283</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;284</td>  <td class="nbHitsCovered">&nbsp;26396</td>  <td class="src"><pre class="src">&nbsp;        Transition currentTransition = (Transition) transitions.elementAt(i);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;285</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="comment">//if (currentTransition.getTargetState().equals(this))</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;286</td>  <td class="nbHitsCovered">&nbsp;26396</td>  <td class="src"><pre class="src">&nbsp;        <span class="keyword">if</span> (currentTransition.isSelfTransition())</pre></td></tr>
<tr>  <td class="numLine">&nbsp;287</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;288</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;          Transition trans = <span class="keyword">new</span> Transition(state, currentTransition.getChars());</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;289</td>  <td class="nbHitsCovered">&nbsp;6</td>  <td class="src"><pre class="src">&nbsp;          state.addTransition(trans);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;290</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;291</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        <span class="keyword">else</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;292</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;293</td>  <td class="nbHitsCovered">&nbsp;26390</td>  <td class="src"><pre class="src">&nbsp;          Transition trans = <span class="keyword">new</span> Transition(currentTransition.getTargetState(), currentTransition.getChars());</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;294</td>  <td class="nbHitsCovered">&nbsp;26390</td>  <td class="src"><pre class="src">&nbsp;          state.addTransition(trans);</pre></td></tr>
<tr>  <td class="numLine">&nbsp;295</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;        }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;296</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      }</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;297</td>  <td class="nbHitsCovered">&nbsp;2330</td>  <td class="src"><pre class="src">&nbsp;      <span class="keyword">return</span> state;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;298</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;299</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
<tr>  <td class="numLine">&nbsp;300</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    <span class="keyword">public</span> String toString()</pre></td></tr>
<tr>  <td class="numLine">&nbsp;301</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    {</pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;302</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;      String string2return = <span class="keyword">null</span>;</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;303</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;      <span class="keyword">if</span> (isTokenState)</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;304</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        string2return = <span class="string">"*"</span>+m_type+<span class="string">"*"</span>;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;305</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;      <span class="keyword">else</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;306</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;        string2return = m_type.toString();</span></pre></td></tr>
<tr>  <td class="numLineCover">&nbsp;307</td>  <td class="nbHitsUncovered">&nbsp;0</td>  <td class="src"><pre class="src"><span class="srcUncovered">&nbsp;      <span class="keyword">return</span> string2return;</span></pre></td></tr>
<tr>  <td class="numLine">&nbsp;308</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;    }</pre></td></tr>
<tr>  <td class="numLine">&nbsp;309</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;}</pre></td></tr>
<tr>  <td class="numLine">&nbsp;310</td>  <td class="nbHits">&nbsp;</td>
  <td class="src"><pre class="src">&nbsp;</pre></td></tr>
</table>

<div class="footer">Report generated by <a href="http://cobertura.sourceforge.net/" target="_top">Cobertura</a> 1.8 on 1/22/07 1:54 PM.</div>
</body>
</html>
